/**
 * Copyright (c) 2011-2014, hubin (jobob@qq.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.sso.comm.domain;


import com.sso.comm.util.IpHelper;

import javax.servlet.http.HttpServletRequest;

public class Token extends TokenBase {

	/* 系统名称 */
	private String app;

	/* 用户 ID（长整型） */
	private Long id;

	private String uid;

	/* 创建 token 当前系统时间 */
	private long time = System.currentTimeMillis();

	public Token(){}

	public Token(HttpServletRequest request, String app) {
		this.setIp(IpHelper.getIpAddr(request));
		this.setApp(app);
	}

	public String getApp() {
		return app;
	}

	public void setApp(String app) {
		this.app = app;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

}
